﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductImage.ascx.cs" Inherits="VIT.Web.Modules.ProductImage.ProductImage" %>
<%@ Register Assembly="VIT.Pre" Namespace="VIT.Pre" TagPrefix="cc" %>

<asp:UpdatePanel runat="server" ID="udpProductImage" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:LinkButton runat="server" ID="lbtAdd" Text="Thêm" OnClick="lbtAdd_Click"></asp:LinkButton>
        <cc:ListView runat="server" ID="lsvProductImage" DataKeyNames="Id"
            OnItemInserting="lsvProductImage_ItemInserting"
            OnItemDeleting="lsvProductImage_ItemDeleting"
            OnItemCanceling="lsvProductImage_ItemCanceling" 
            OnItemDataBound="lsvProductImage_ItemDataBound">
            <LayoutTemplate>
                <table>
                    <tr>
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                    </tr>
                    
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <td>
                    <asp:ImageButton runat="server" ID="ibtImage" Width="100px" Height="100px" style="margin-left:20px;" CommandName="Delete" />
                </td>
            </ItemTemplate>
            <InsertItemTemplate>
                <td>
                    <asp:FileUpload runat="server" ID="fupProduct" />
                    <asp:ImageButton runat="server" ID="ibtApply" ToolTip="Lưu lại" CssClass="icon-32-apply" CommandName="Insert" EnableViewState="false" Value=""></asp:ImageButton>
                    <asp:ImageButton runat="server" ID="ibtCancel" ToolTip="Hủy bỏ" CssClass="icon-32-cancel" CommandName="Cancel" EnableViewState="false" Value=""></asp:ImageButton>
                </td>
            </InsertItemTemplate>
        </cc:ListView>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="lbtAdd" EventName="Click" />
        <asp:PostBackTrigger ControlID="lsvProductImage" />
    </Triggers>
</asp:UpdatePanel>